CFLAGS = -mcmodel=large -fno-builtin -m64 -I ../include/ -Wall -Werror -g

OBJS = int.o trap.o vsprintf.o irq.o panic.o mm.o pci.o timer.o sched.o sys.o keyboard.o tty.o console.o 

all: $(OBJS) kernel.o 

%.o: %.S
	gcc -E $*.S -I ../include > $*.s
	as --64 $*.s -o $*.o 

%.o: %.c
	gcc -c $*.c -o $*.o $(CFLAGS)

kernel.o: 
	ld -r -o kernel.o $(OBJS)

clear:
	rm *.o *.s

